package com.wf.course.dao;

import java.math.BigDecimal;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.utils.page.PageBean;
import com.wf.course.model.member.CoinLog;
import com.wf.course.model.member.Member;

/**
 * 播放记录
 *
 */
public interface ICoinLogMapper {

	/**
	 * 根据pageBean中封装的查询条件查询
	 * @param pageBean
	 * @return
	 */
	public List<CoinLog> queryList(PageBean<CoinLog> pageBean);
	/**
	 * 查询总数量
	 * @param pageBean
	 * @return
	 */
	public Integer getTotalCount(PageBean<CoinLog> pageBean);
	/**
	 * 添加
	 * @param 
	 */
	public void saveCoinLog(CoinLog coinLog);
	/**
	 * 修改
	 * @param 
	 */
	public void updateCoinLog(CoinLog coinLog);
	/**
	 * 查询
	 * @param id
	 */
	public CoinLog queryCoinLogById(@Param("id")Integer id);
	/**
	 * 删除
	 * @param id
	 */
	public void deleteById(@Param("id")Integer id);
	/**
	 * 查询
	 */
	public List<CoinLog> queryCoinLogs();
	/**
	 * 根据订单和流向查询记录
	 * @param orderCode
	 * @param flowFlag
	 * @return
	 */
	public CoinLog queryCoinLogByOrderCode(@Param("orderCode") String orderCode,@Param("flowFlag") Integer flowFlag) ;
	/**
	 * 订单退货，更新铜钱备注和删除标识
	 */
	public void updateCoinRemakById(@Param("remarkInfo") String remarkInfo,
			@Param("deleteFlag") Integer deleteFlag,@Param("id") Integer id);
	
	
	/**
	 * 订单退货，减去相应铜钱，更新铜钱备注
	 */
	public void updateCoinValueById(@Param("coinValue")String coinValue ,@Param("remarkInfo")String remarkInfo,
			@Param("id")Integer id);
	
	/**
	 * 查询赚或花费的铜钱
	 */
	public  CoinLog queryZhByUserId(@Param("userId")Integer userId,@Param("flowFlag")Integer flowFlag);
	 
	/**
	 * 根据订单编号，更新所有该订单下的deleteFlag状态
	 * @param orderCode
	 * @param deleteFlag
	 */
	public void updateCoinLogByOrderCode(@Param("orderCode") String orderCode,@Param("deleteFlag") Integer deleteFlag);
	
	public List<CoinLog> getUserid(@Param("userId")Integer userId);
	
	public List<CoinLog> queryLists(PageBean<CoinLog> pageBean);
	
	public Integer getTotalCounts(PageBean<CoinLog> pageBean);
}
